package com.manning.s2ip.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Transient;

@Entity
@NamedQueries({
  @NamedQuery(name="Person.findAll", query="SELECT p FROM Person p")		
})
public class Person implements Persistent<Integer> {

	private Integer personId;
	
	private String personName;
	
	private Date birthDay;

	private Integer coolness;


	@Id
	@GeneratedValue	
	public Integer getPersonId() {
		return personId;
	}

	public void setPersonId(Integer personId) {
		this.personId = personId;
	}

	@Transient
	public Integer getKey() {
		return personId;
	}

	@Column(length=32, nullable=false)
	public String getPersonName() {
		return personName;
	}

	public void setPersonName(String personName) {
		this.personName = personName;
	}
	
	@Column(nullable=false)
	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}
	
	@Column(nullable=false)
	public Integer getCoolness() {
		return coolness;
	}

	public void setCoolness(Integer coolness) {
		this.coolness = coolness;
	}
	
}
